﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using xmt = TongJS_Prompt.JsPrompt;//using 別名用法

public partial class using指令用法 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        using定義對象();
       // usingAs();//2.using 別名用法
    }

    //using using指令用法
    //1。using 引用命名空間
    //如 using System.Web.UI.HtmlControls;
    //2.using 別名用法
    protected void usingAs()
    {
        //using xmt = TongJS_Prompt.JsPrompt;
        xmt aa = new xmt();
       tt.Text += aa.Input_prompt(tt.ClientID + "=" + "121212,164646").ToString();
    }
    protected void using定義對象()
    { 
        using(Demo aas = new Demo())
        {
            aas.Dispose();
        }
    }

}

class Demo:IDisposable
{
    public void Dispose()
    {
        Console.Write("Dispose"); 
    }

    public void DemoMethod()
    {
        Console.WriteLine("hi");
    }
}



